// 存储功能统一封装

function get (key) {
  return localStorage.getItem(key)
}
function set (key, value) {
  // type监测基本类型
  // instanceof  constructor
  if (value && (value.constructor === Array || value.constructor === Object)) {
    value = JSON.stringify(value)
  }
  localStorage.setItem(key, value)
}

function remove (key) {
  localStorage.removeItem(key)
}

export {
  get,
  set,
  remove
}
